from typing import List


def commonChars(words: List[str]) -> List[str]:
    minfreq = [float("inf")] * 26
    for word in words:
        freq = [0] * 26
        for ch in word:
            freq[ord(ch) - ord("a")] += 1
        for i in range(26):
            minfreq[i] = min(minfreq[i], freq[i])
        
    ans = list()
    for i in range(26):
        ans.extend([chr(i + ord("a"))] * minfreq[i])
    return ans

words = ["bella","label","roller"]
res = commonChars(words)
print("res:",res)